home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Bus / S / S7P 3.6 Manual.sit / S7P 3.6 Manual.rsrc / TEXT_135.txt < prev    next >
Encoding:
Text File  |  1993-11-14  |  4.4 KB  |  89 lines

  1. AllowAccess
  2.  
  3. AllowAccess(Flag)
  4.  
  5. Turns on or off System 7 Pack‚Ñ¢'s standard AppleEvent handling (built-in handlers for DoScript and data & structure-access events). The event handling is initially turned off. Calling this function with a non-zero Flag will enable standard events. Calling this with 'Flag' set to zero will disable standard event handling. If an application tries to send an AppleEvent when they're disabled, it will get back an error message 'AppleEvents not allowed at this time'. This doesn't affect handlers installed with HandleAEVT.
  6.  
  7. GetAEMessage
  8.  
  9. GetAEMessage(Msg)
  10.  
  11. Gets the text-based direct object received with the last AppleEvent. This will usually be called in a procedure installed via HandleAEVT. To make sure that what you received is text, you should call GetAEType and make sure that the type isn‚Äôt PICT. Aany numeric type can be converted to text and will be returned as a string by GetAEMessage, but pictures will result in a null string. You can also use the low-level interface to extract multiple pieces of data with finer control.
  12.  
  13. GetAEPict
  14.  
  15. Err:=GetAEPict(aPicture)
  16.  
  17. This should be called in a procedure installed via HandleAEVT to retrieve picture data from the AppleEvent. Use this function to handle an event that was sent with AESendPict.
  18.  
  19. Example:
  20. _________________________________________________________________
  21. HandleAEVT(‚ÄúDEMO‚Äù;‚ÄùPICT‚Äù;‚ÄùReceive Picture‚Äù)
  22.  
  23. -- Receive Picture --
  24. GetAEType($type)
  25. If ($type # ‚ÄúPICT‚Äù)
  26.     Alert(‚ÄúWrong data type received:‚Äù+$type)
  27. Else
  28.     $err:=GetAEPicture(picVariable)
  29.     if ($err#0)
  30.        Alert(‚ÄúError receiving picture:‚Äù+string($err))
  31.     end if
  32.     Create Record([Pictures])
  33.     [Pictures]thePicture:=picVariable
  34.     Save Record([Pictures])
  35. End if
  36. _________________________________________________________________
  37.  
  38. GetAEType
  39.  
  40. GetAEType(theType)
  41.  
  42. Returns the data type of the direct object of the last AppleEvent. This should be called in a procedure installed via HandleAEVT to ensure that the received data is in the expected format. A procedure that expects PICT will be able to receive only PICT by calling GetAEPict.  A procedure that expects text can receive any text or numeric type by calling GetAEMessage.
  43.  
  44. GetReturnAddr
  45.  
  46. GetReturnAddr(Target)
  47.  
  48. Gets the return address of the last AppleEvent received. The target is identical to one returned by SelectAddress and may be used in any of the AppleEvent functions which take a target address. It should be disposed of when you finish with it. This should be used in a procedure installed via HandleAEVT.
  49.  
  50. HandleAEVT
  51.  
  52. Err:=HandleAEVT(Class;ID;Command)
  53.  
  54. Installs a 4D¬Æ command line or procedure to be executed in response to a particular AppleEvent. Don't try to replace any of the 4 required events (class 'aevt' & ID 'odoc', 'oapp', 'pdoc', or 'quit') or one of the standard events handled by System 7 Pack‚Ñ¢.
  55.  
  56. NOTE: versions 3.1 and later of S7P allow you to remove the built-in ‚Äòaevt‚Äô,‚Äôquit‚Äô handler, after which you can add your own quit procedure which can do any necessary clean up and then call QUIT 4D.
  57.  
  58. 4D 3.0 NOTE: All AppleEvent handlers execute in a process called Apple Event Manager. This process has no window associated with it. Therefore, you must never call MESSAGE without first creating a window.
  59.  
  60. Example:
  61. _________________________________________________________________
  62. err:=HandleAEVT("DEMO";"TEST";"DemoHandler")
  63.  
  64. -- DemoHandler --
  65. GetAEMessage($txt)
  66. GetReturnAddr($sender)
  67. $err:=AESend($sender;"DEMO";"ACK!";$txt)
  68. Alert($txt)
  69. $err:=DisposeAddress($sender)
  70. _________________________________________________________________
  71.  
  72. IgnoreAEVT
  73.  
  74. Err:=IgnoreAEVT(Class;ID)
  75.  
  76. Removes a previously installed AppleEvent handler.  Note: you may use this command to remove the built-in handler for ‚Äòaevt‚Äô,‚Äôquit‚Äô to allow a custom quit handler to be used. Don't use this to remove any of 4D's standard event handlers other than ‚Äòquit‚Äô.
  77.  
  78. ProcessAEVT
  79.  
  80. Allows AppleEvents to be received and processed while 4D is in a tight processing loop. You only need to use this function if a loop is waiting for an AppleEvent to set some flag before it exits, since 4D normally doesn‚Äôt poll for events during such loops. THIS COMMAND SHOULD NEVER BE NECESSARY IN 4D V3.0 or later.
  81.  
  82. Example:
  83. _________________________________________________________________
  84. MyEventFlag := False        ` will be set in AE handler
  85. while (MyEventFlag = False)
  86.     ProcessAEVT
  87. end while
  88. _________________________________________________________________
  89.